package com.testfileupload.uploadimg.design.strategy.enums;

//枚举中定义抽象方法必须实现
public enum Calculator {
    ADD("+"){
        @Override
        public int exec(int a,int b){
            return a+b;
        }
    },
    SUB("-"){
        @Override
        public int exec(int a, int b) {
            return 0;
        }
    };
    String value = "";
    //定义成员类型
    private Calculator(String value){
        this.value= value;
    }
    public String getValue(){
        return this.value;
    }

    public abstract int exec(int a,int b);
}
